//
//  Exploit.h
//  Dopamine
//
//  Created by Lars Fröder on 10.01.24.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

typedef enum {
    EXPLOIT_TYPE_KERNEL = 0,
    EXPLOIT_TYPE_PAC,
    EXPLOIT_TYPE_PPL,
    EXPLOIT_TYPE_COUNT,
} ExploitType;

@interface DOExploit : NSObject
{
    void *_handle;
    NSDictionary *_flavorInfo;
    BOOL _supportLoaded;
    BOOL _supported;
}

@property (nonatomic) NSString *name;
@property (nonatomic) NSString *identifier;
@property (nonatomic) NSString *flavorName;
@property (nonatomic) NSString *executablePath;
@property (nonatomic) uint64_t priority;
@property (nonatomic) ExploitType type;

@property (nonatomic, readonly) NSString *displayName;

- (instancetype)initWithPath:(NSString *)exploitPath info:(NSDictionary *)exploitInfo flavorName:(NSString *)flavorName flavorDictionary:(NSDictionary *)flavorInfo;

- (BOOL)isSupported;

- (int)load;
- (int)run;
- (int)cleanup;

@end

NS_ASSUME_NONNULL_END
